import '../../manger/network_utils.dart';

class UmengEvent {
  /// 发送事件（包含固定参数 + 自定义字段）
  static Future<void> trackEvent(String eventId, String customValue, String tracking) async {
    final Map<String, dynamic> attributes = {
      'reason': tracking,
      'channel': '',
      'code': eventId,
      'pageUrl': '',
      'result': '',
      'trackingPosition': customValue,
    };

    _logoInfo(attributes);
  }

  static Future<void> _logoInfo(Map<String, dynamic> attributes) async {
    try {
      final response = await NetworkUtils.post(
        RequestCmd.logInfo,
        body: attributes,
      );
      print(response);
  
    } catch (e) {
      print('Error fetching user info: $e');
    }
  }
}
